<?php

require_once 'MenuModel.php';
require_once 'MenuView.php';

class MenuController
{
    private $menuName;

    public function __construct( $menuName )
    {
        $this->menuName = $menuName;
    }
    
    public function DoControll()
    {
        $menuModel = new MenuModel( $this->menuName );
        $menuView = new MenuView( $menuModel->GetMenuElements() );

        $html = '';

        $menuItems = $menuModel->GetMenuItems();
        if ( count( $menuItems ) > 0 )
        {
            $html .= $menuView->DoMenu( $menuItems );
        }
        
        return $html;
    }
}
